-- call_airship
-- created by panyl
-- 召唤飞艇

return {
    apply = function(source, target, skillId, round, para, extra)
        -- 抛出事件
        EventMgr.fire(event.DUNGEON_SKY_COMBAT_START, {});

        -- 返回作用目标
        return { source, };
    end,

    check = function(skillId)
        -- 战力没了
        local data = ME.user.dbase:query("dungeon_sc_data", {});
        if data["fight_ability"] <= 0 then
            return "no_fight_ability";
        end

        -- 副本中不能使用
        if DungeonInstanceM.isInInstance() then
            return "forbid_call_airship";
        end

        -- 夹层迷宫
        if UnrealDungeonM.isInUnreal() then
            return "forbid_call_airship";
        end

        -- 如果怪物全清了
        if sizeof(FormulaM.getAliveMonsters()) <= 0 and sizeof(SteamMachineM.getAliveMachines()) <= 0 then
            return "no_monster";
        end

        return true;
    end,

    parse = function(desc)
        local arr = string.explode(desc, ",");
        return {};
    end,

    -- 解析技能描述
    parseDesc = function(source, skillId, desc, para)
        if not desc then
            return;
        end

        return desc;
    end,
};
